package com.client.koshercook.client;

import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.event.dom.client.ClickHandler;
import com.google.gwt.user.client.ui.SuggestBox;

public class IngTextBox extends SuggestBox{
	private boolean pressed = false; //represent non-exter pressed
	
	/** construct the oracle suggestion ingredients name to the user */
	public IngTextBox(){
		super(Client.oracle);
		setText("הכנס שם רכיב");
		setLimit(5);
		setAutoSelectEnabled(false);
		setFocus(true);
		addStyleName("ingNameTextBox");	//TODO: setStyleName()?
		getTextBox().addClickHandler(new ClickHandler(){
			public void onClick(ClickEvent event) {
				setText("");
			}
		});
		
	}

	/** return press */
	public boolean isPressed(){
		return pressed;
	}
	
	/** and 1 press */
	public void setPressed(){
		pressed = true;
	}
	
	/** reset presses */
	public void resetPress(){
		pressed = false;
	}
}
